Integrand size = 26, antiderivative size = 371 \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 \sqrt {-f} \sqrt {g}}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \sqrt {-f} \sqrt {g}}-\frac {b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{\sqrt {-f} \sqrt {g}}+\frac {b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{\sqrt {-f} \sqrt {g}}+\frac {b^2 n^2 \operatorname {PolyLog}\left (3,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{\sqrt {-f} \sqrt {g}}-\frac {b^2 n^2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{\sqrt {-f} \sqrt {g}} \]
[Out]
Time = 0.27 (sec) , antiderivative size = 371, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {2456, 2443, 2481, 2421, 6724} \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=-\frac {b n \operatorname {PolyLog}\left (2,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{\sqrt {-f} \sqrt {g}}+\frac {b n \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{\sqrt {g} d+e \sqrt {-f}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{\sqrt {-f} \sqrt {g}}+\frac {\log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{d \sqrt {g}+e \sqrt {-f}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 \sqrt {-f} \sqrt {g}}-\frac {\log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 \sqrt {-f} \sqrt {g}}+\frac {b^2 n^2 \operatorname {PolyLog}\left (3,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{\sqrt {-f} \sqrt {g}}-\frac {b^2 n^2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{\sqrt {g} d+e \sqrt {-f}}\right )}{\sqrt {-f} \sqrt {g}} \]
[In]
[Out]
Rule 2421
Rule 2443
Rule 2456
Rule 2481
Rule 6724
Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {\sqrt {-f} \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f \left (\sqrt {-f}-\sqrt {g} x\right )}+\frac {\sqrt {-f} \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f \left (\sqrt {-f}+\sqrt {g} x\right )}\right ) \, dx \\ & = -\frac {\int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\sqrt {-f}-\sqrt {g} x} \, dx}{2 \sqrt {-f}}-\frac {\int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\sqrt {-f}+\sqrt {g} x} \, dx}{2 \sqrt {-f}} \\ & = \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 \sqrt {-f} \sqrt {g}}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \sqrt {-f} \sqrt {g}}-\frac {(b e n) \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{d+e x} \, dx}{\sqrt {-f} \sqrt {g}}+\frac {(b e n) \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{d+e x} \, dx}{\sqrt {-f} \sqrt {g}} \\ & = \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 \sqrt {-f} \sqrt {g}}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \sqrt {-f} \sqrt {g}}-\frac {(b n) \text {Subst}\left (\int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (\frac {e \left (\frac {e \sqrt {-f}+d \sqrt {g}}{e}-\frac {\sqrt {g} x}{e}\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{\sqrt {-f} \sqrt {g}}+\frac {(b n) \text {Subst}\left (\int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (\frac {e \left (\frac {e \sqrt {-f}-d \sqrt {g}}{e}+\frac {\sqrt {g} x}{e}\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{\sqrt {-f} \sqrt {g}} \\ & = \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 \sqrt {-f} \sqrt {g}}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \sqrt {-f} \sqrt {g}}-\frac {b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{\sqrt {-f} \sqrt {g}}+\frac {b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{\sqrt {-f} \sqrt {g}}+\frac {\left (b^2 n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {\sqrt {g} x}{e \sqrt {-f}-d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{\sqrt {-f} \sqrt {g}}-\frac {\left (b^2 n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (\frac {\sqrt {g} x}{e \sqrt {-f}+d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{\sqrt {-f} \sqrt {g}} \\ & = \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 \sqrt {-f} \sqrt {g}}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \sqrt {-f} \sqrt {g}}-\frac {b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{\sqrt {-f} \sqrt {g}}+\frac {b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{\sqrt {-f} \sqrt {g}}+\frac {b^2 n^2 \text {Li}_3\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{\sqrt {-f} \sqrt {g}}-\frac {b^2 n^2 \text {Li}_3\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{\sqrt {-f} \sqrt {g}} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.48 (sec) , antiderivative size = 485, normalized size of antiderivative = 1.31 \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\frac {\arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right ) \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2+i b n \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right ) \left (\log (d+e x) \left (\log \left (1-\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )-\log \left (1-\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )-\operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )\right )+\frac {1}{2} i b^2 n^2 \left (\log ^2(d+e x) \log \left (1-\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )-\log ^2(d+e x) \log \left (1-\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )+2 \log (d+e x) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )-2 \log (d+e x) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )-2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )+2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )\right )}{\sqrt {f} \sqrt {g}} \]
[In]
[Out]
\[\int \frac {{\left (a +b \ln \left (c \left (e x +d \right )^{n}\right )\right )}^{2}}{g \,x^{2}+f}d x\]
[In]
[Out]
\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2}}{g x^{2} + f} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2}}{g x^{2} + f} \,d x } \]
[In]
[Out]
\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2}}{g x^{2} + f} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\int \frac {{\left (a+b\,\ln \left (c\,{\left (d+e\,x\right )}^n\right )\right )}^2}{g\,x^2+f} \,d x \]
[In]
[Out]